package com.wzy.filter;


import java.io.IOException;

import jakarta.servlet.*;
import jakarta.servlet.annotation.WebFilter;

public class MyFilter implements Filter {

    @Override
    public void init(FilterConfig filterConfig) throws ServletException {
        System.out.println("初始化方法执行");
    }
    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
        System.out.println("doFilter前");
        filterChain.doFilter(servletRequest,servletResponse);
        System.out.println("doFilter后");
    }

    @Override
    public void destroy() {
        System.out.println("销毁方法");
    }


}
